﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:BusinessIntelligenceToolkit.Controls">
    <Style TargetType="{x:Type local:BitScrollViewer}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:BitScrollViewer}">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <ScrollContentPresenter>
                            <ScrollContentPresenter.Content>
                                <local:BitStackPanel x:Name="PART_ItemsHost"
                                                     HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                     CollectionView="{Binding RelativeSource={RelativeSource TemplatedParent},
                                                                              Path=CollectionView}"
                                                     ContainerGenerator="{Binding RelativeSource={RelativeSource TemplatedParent},
                                                                                  Path=ItemsControl.ContainerGenerator}"
                                                     Orientation="{TemplateBinding Orientation}"
                                                     ScrollViewer="{Binding RelativeSource={RelativeSource TemplatedParent}}" />
                            </ScrollContentPresenter.Content>
                        </ScrollContentPresenter>

                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                            Grid.Column="1"
                                            Orientation="{TemplateBinding Orientation}"
                                            ViewportSize="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>